<script setup>
import { Toast } from 'vant'
import { ref, reactive } from 'vue'

const News = reactive([
    {
        num: "2", price: "2.00", desc: "描述信息", title: "一心堂",
    },
    {
        num: "2", price: "2.00", desc: "描述信息", title: "一心堂",
    },
    {
        num: "2", price: "2.00", desc: "描述信息", title: "一心堂",
    },
    {
        num: "2", price: "2.00", desc: "描述信息", title: "一心堂",
    },
    {
        num: "2", price: "2.00", desc: "描述信息", title: "一心堂",
    },    {
        num: "2", price: "2.00", desc: "描述信息", title: "一心堂",
    },
])

const count = ref(0);
const loading = ref(false);
const onRefresh = () => {
    setTimeout(() => {
        Toast('刷新成功');
        loading.value = false;
        count.value++;
    }, 1000);
};
</script>
<template>
    <!-- <div>lesson课程</div> -->
    <van-swipe-cell>
        <van-pull-refresh v-model="loading" @refresh="onRefresh">
            <van-card v-for="item in News" :num="item.num" :price="item.price" :desc="item.desc" :title="item.title"
                class="goods-card" thumb="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg" />
        </van-pull-refresh>
    </van-swipe-cell>

    <router-view></router-view>
</template>
<style scoped>
.goods-card {
    margin: 0;
    background-color: white;
}

.delete-button {
    height: 100%;
}
</style>